/*
 * edit-folder-dialog.js
 */

var params = window.arguments[0];

var EditFolderDialog = {
	_log : new Logger("EditFolderDialog"),

	startup : function() {
		$("folder-name").value = params.initialName;
		this.focus();
	},

	onOk : function() {
		try {
			var name = $("folder-name").value.trim();
			if (name == "") {
				var msg = LocaleUtils.getString("folder_name_empty_msg");
				alert(msg);
				this.focus();
			} else {
				params.name = name;
				setTimeout("close();", 100);
			}
		} catch (e) {
			this._log.error("e: " + e);
		}
	},

	focus : function() {
		$("folder-name").select();
		$("folder-name").focus();
	}
}